Conversation
👷 Deploy Preview for virtual-coffee-io processing.
|
danieltott
left a comment
There was a problem hiding this comment.
Hey @manya706 - this is a really good start! A couple notes:
- There's no page at https://virtualcoffee.io/blog
- It would be great to get all of the sub-pages in here. For each section, if you take a look at the
generateStaticParamsfunction, you can see how we're getting all of the sub-pages and their paths. For instance, with newsletters, take a look atsrc/app/newsletter/issues/[slug]/page.tsx:
export async function generateStaticParams() {
const newsletters = await getNewsletters();
return newsletters.map((newsletter) => ({
slug: newsletter.href.replace('/newsletter/issues/', ''),
}));
}We're using the getNewsletters function and getting url information that way. Each sub-section has a similar setup, you can search for generateStaticParams and find those.
If this is too much, that might be ok, and maybe we can start with the basic version that links to the top-level pages, and then improve it with further iterations. Take a look and let me know!
|
Oh one other thing - we should remove the |
|
hey @danieltott ! when i am importing generateStaticParams function, it keeps on giving me that the file cannot be located when i am putting the correct location url. could you help me with this? i have tried changing everything but its not locating the file node:internal/modules/esm/resolve:265
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\manya\virtualcoffee.io\src\app\newsletter\issues\[slug]\page' imported from C:\Users\manya\virtualcoffee.io\src\app\newsletter\issues\[slug]\check.js
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1169:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
at link (node:internal/modules/esm/module_job:95:36) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///C:/Users/manya/virtualcoffee.io/src/app/newsletter/issues/[slug]/page'
} |
…virtualcoffee.io into feature/create-sitemap
…virtualcoffee.io into feature/create-sitemap
Linked Issue
closes #1170
Description
This pull request introduces a new
generate-sitemap.mjsfile to automatically generate and update the sitemap for the website. The script consolidates the sitemap generation logic and ensures it runs after the build process.Methodology
New Script: Created generate-sitemap.mjs to generate the sitemap.
Postbuild Hook: Updated package.json to include a
postbuildscript that runs the sitemap generation script automatically after the build process.Verification
sitemap.xmlis generated correctly.Code of Conduct